/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mobiubiq.directory.client.data;

import org.kalmeo.kuix.core.Kuix;
import org.kalmeo.kuix.core.model.DataProvider;

/**
 *
 * @author Marnix Renne
 */
public class DynamicDataProvider extends DataProvider {
    // Declare static values to identify the provided data
    private static final String PLATFORM_NAME_PROPERTY = "platformName";
    private static final String GENDER_PROPERTY = "gender";

   // create a value variable
    private String gender = "unknown";

    public void setGender(String gender) {
        this.gender = gender;
        dispatchUpdateEvent(GENDER_PROPERTY);
    }

    protected Object getUserDefinedValue(String property) {
        if(PLATFORM_NAME_PROPERTY.equals(property)) {
            return Kuix.getCanvas().getPlatformName();
        }
        if(GENDER_PROPERTY.equals(property)) {
            return gender;
        }
        return null;
    }
}
